import 'package:share_fit/app/controllers/base/base_controller.dart';
import 'package:share_fit/app/ute/uteped_const.dart';

import 'space_state.dart';

class SpaceLogic extends BaseController {
  static const REMOTE_PATH = "space";

  final SpaceState state = SpaceState();

  void setCount(int str) {
    state.count = str;
    update(["space_count"]);
  }

  void setAvatar(String url) {
    state.avatar = url;
    update(["space_avatar"]);
  }

  void setNickName(name) {
    state.nickName = name;
    update(["space_name"]);
  }

  @override
  String getRemotePath() {
    return REMOTE_PATH;
  }

  @override
  void initState() {
    // TODO: implement initState
  }

  @override
  void onRemoteEvent(event, method) {
    // TODO: implement onRemoteEvent
  }

  Future<void> setMotionGoal(Map<String, Object> params, {required Null Function(dynamic _) back}) async {
    var result = await sRemoteReqAsync(UTEPedConst.methodSetMotionGoal, params);
    back(result);
  }

}
